import React, { useEffect } from 'react';
import { useDispatch, useSelector, useHistory, useLocation } from 'umi';
import './colorDetaile.less';
const colorDetaile: React.FC = () => {
  const dispatch = useDispatch();
  const history = useHistory();
  const location = useLocation();
  //利用 umi的数据管理dva的方法useSelector 拿到数据
  const { IYea } = useSelector((module) => {
    return { ...module.user };
  });
  //派发
  useEffect(() => {
    dispatch({
      type: 'user/IYearC',
      payload: location.state,
    });
  });
  return (
    <div className="color">
      <p>全部颜色</p>
      {/* <div >
                <p className="c-type">
                    {
                        IYea&&IYea.map((item:any)=>{
                                return <span>{item}</span>
                        })
                    }
                </p>
        </div> */}
    </div>
  );
};
export default colorDetaile;
